<template>
  <div class="container">
    <div class="item1">
      <div class="xiala">
        <el-col :span="24">
          <el-menu
            router
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
          >
            <el-sub-menu index="1">
              <template #title>
                <span>练习室</span>
              </template>
              <el-menu-item index="/practive" style="color: red"
                >我的练习室</el-menu-item
              >
            </el-sub-menu>
            <el-menu-item index="/practive/mediaCache">缓存</el-menu-item>
            <el-button text @click="open" style="margin-left: 5px; color: black"
              >音频库</el-button
            >
            <el-menu-item index="/practive/Collections">收藏</el-menu-item>
            <el-menu-item index="/practive/viewRecords">历史</el-menu-item>
          </el-menu>
        </el-col>
      </div>
      <!-- <div class="left"></div> -->
    </div>
    <div class="item2">
      <div class="headerItem">
        <div
          class="header-tab-item hoverable"
          :class="flag === 1 ? 'active' : ''"
          @click="flag = 1"
        >
          <span class="title">资源</span>
        </div>
        <div
          class="header-tab-item hoverable"
          :class="flag === 2 ? 'active' : ''"
          @click="flag = 2"
        >
          <span class="title">视频课</span>
        </div>
        <div
          class="header-tab-item hoverable"
          :class="flag === 3 ? 'active' : ''"
          @click="flag = 3"
        >
          <span class="title">线下课</span>
        </div>
        <div
          class="header-tab-item hoverable"
          :class="flag === 4 ? 'active' : ''"
          @click="flag = 4"
        >
          <span class="title">直播课</span>
        </div>
      </div>
      <div class="right">
        <div class="demo-input-size" style="margin-top: 15px">
          <el-row :gutter="46">
            <el-col :span="7" style="margin-left: 40px">
              <el-input
                v-model="input1"
                class="w-50 m-2"
                size="large"
                :prefix-icon="Search"
                style="width: 300px"
            /></el-col>
            <el-col :span="6"
              ><el-button type="info" plain style="height: 40px"
                >搜索</el-button
              ></el-col
            >
            <div class="delete"><span>批量删除</span></div>
          </el-row>
        </div>
        <shoucang/>
      </div>
    </div>
  </div>
</template>
  
  <script lang="ts" >
  import shoucang from '../../../components/practive/shoucang/shoucang.vue'
export default {
  name: "Collections",
  components:{
    shoucang,
  }
};
</script>
  
  <script lang="ts" setup>
import { ref } from "vue";
import { Search } from "@element-plus/icons-vue";
import { ElMessage, ElMessageBox } from "element-plus";
import type { Action } from "element-plus";

import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from "@element-plus/icons-vue";


// active切换flag标识
let flag = ref(0);
// 搜索input框的索引
const input1 = ref("");



const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
// 音频库的弹窗
const open = () => {
  ElMessageBox.alert('请打开中舞网APP，点击"练习室"-"音频库"中查看。', {
    confirmButtonText: "确定",
    // callback: (action: Action) => {
    //   ElMessage({
    //     type: 'info',
    //     message: `action: ${action}`,
    //   })
    // },
  });
};
</script>
  
  <style scoped>
.container {
  background-color: #c1c1c1;
  width: 1200px;
  margin: auto;
  font-size: 14px;
  display: flex;
}
.xiala {
  width: 170px;
  border-radius: 5px;
  height: 50px;
  line-height: 50px;
}

/* .left {
    width: 170px;
    height: 200px;
    border-radius: 5px;
    margin-top: 10px;
  } */

.headerItem {
  width: 1020px;
  height: 100px;
  background-color: #fff;
  border-radius: 5px;
  float: right;
  display: flex;
  align-items: center;
}
.active {
  border-bottom: solid 3px hotpink;
}
.header-tab-item {
  display: flex;

  padding: 28px 40px;
}

.right {
  width: 1020px;
  height: 730px;
  background-color: #fff;
  border-radius: 5px;
  float: right;
  margin-top: 10px;
  position: relative;
}

.delete {
  position: absolute;
  top: 10px;
  right: 70px;
}
</style>
  